package com.bluexmicro.ota.asset

enum class AssetType(val code: Byte) {
    FACE(1), DICT(2)
}

data class AssetBean(
    val type: AssetType,
    val name: String,
    val rawData: ByteArray,
    val crc32: Int
) {
    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as AssetBean

        if (type != other.type) return false
        if (name != other.name) return false
        if (!rawData.contentEquals(other.rawData)) return false
        if (crc32 != other.crc32) return false

        return true
    }

    override fun hashCode(): Int {
        var result = type.hashCode()
        result = 31 * result + name.hashCode()
        result = 31 * result + rawData.contentHashCode()
        result = 31 * result + crc32
        return result
    }
}